#
# @lc app=leetcode.cn id=26 lang=python3
#
# [26] 删除排序数组中的重复项
#

# @lc code=start
class Solution:
    def removeDuplicates(self, nums):
        n = len(nums)
        j = 1
        if n <= 1: return n
        for i in range(1, n):
            if nums[i - 1] != nums[i]:
                nums[j] = nums[i]
                j += 1
        return j

# @lc code=end

